﻿@model IEnumerable<MiniBlog.Core.ViewModels.ListView.ListPostViewModel>

@{
    ViewData["Title"] = "博文管理";
}

<h4>Posts</h4>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Category)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreateTime)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Category)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CreateTime)
            </td>
            <td>
                @Html.ActionLink("编辑内容", "Content", new { id = item.Id }) |
                @Html.ActionLink("编辑", "Post", new { id = item.Id }) |
                @Html.ActionLink("删除", "DeletePost", new { id = item.Id })
            </td>
        </tr>
}
    </tbody>
</table>
<pager action-url="/Home/Posts" option="ViewBag.Options"></pager>